1. Field of the Invention
The present invention relates to an image processing apparatus and an image pickup apparatus, and more particularly to an image processing apparatus for correcting for chromatic aberration of magnification for a taken image, an image pickup apparatus, a method of correcting for chromatic aberration of magnification, and a computer-readable storage medium storing a program for correcting for chromatic aberration of magnification.
2. Description of the Related Art
In general, in image pickup apparatuses such as digital cameras, a color shift appears in a taken image due to chromatic aberration of magnification occurring in an image-forming optical system such as an image pickup lens. The color shift may lead to a considerable degradation in the quality of the taken image.
On the other hand, the number of pixels in an image pickup device used in image pickup apparatuses such as digital cameras increases year by year, and unit pixel size tends to decrease. Thus, even with chromatic aberration of magnification at such a level as to pose little problem in the past, a color shift may degrade the quality of a taken image.
To correct for a color shift in a taken image, for example, it is known that the amount of chromatic aberration of magnification is detected according to the distance from a reference position to the taken image, and chromatic aberration is corrected based on the detected amount of chromatic aberration of magnification. Here, a position at which the sum of differences between color components is the minimum is searched for to obtain the amount of color shift at that position (see, for example, Japanese Laid-Open Patent Publication No. 2000-299874).
Further, it is known that RAW data comprised of pixel arrays of a plurality of types color components in a predetermined array pattern is taken in, and the correlation between two types of color components included in the RAW data is calculated to detect the width of color shift (the amount of color shift). Here, based on the width of color shift, the amount of chromatic aberration of magnification in an image-forming optical system that has taken an image (see, for example, Japanese Laid-Open Patent Publication No. 2006-20275).
Chromatic aberration of magnification occurs due to focus positions of respective color wavelengths differing according to image height from the center of an optical axis of an image-forming optical system such as an image pickup lens toward an area peripheral to the image-forming optical system. Chromatic aberration of magnification varies with image-forming optical systems such as image pickup lenses, and does not have only a feature of monotonously increasing from the center of an optical axis toward an area peripheral to that.
FIG. 6 is a diagram showing the amount of shift in red or blue focus position relative to green that is a representative value of a color filter used in an image pickup device such as a digital camera.
Referring to FIG. 6, the amount of shift in focus, that is, the amount of chromatic aberration of magnification may not be proportional to the distance from the center of an optical axis (that is, image height). In other words, the amount of chromatic aberration of magnification may not monotonously increase as the distance from the center of an optical axis increases.
When the amount of chromatic aberration of magnification is to be detected and corrected in each area of a taken image in the case where the amount of chromatic aberration of magnification is not proportional to the distance from the center of an optical axis as mentioned above, edges of a subject may not be detected depending on conditions of the subject such as the sky. For this reason, the amount of correction for the amount of chromatic aberration of magnification may not be obtained from the taken image.
In any case, when the amount of chromatic aberration of magnification is not proportional to the distance from the center of an optical axis, chromatic aberration of magnification may be corrected using an inappropriate amount of correction depending on conditions of a subject. For example, as shown in FIG. 6, assume that the actual amount of chromatic aberration of magnification changes as indicated by black circles 611 according to the distance from the center of an optical axis (image height) (the black circles indicate the relationship between image height and the amount of chromatic aberration of magnification according to lens design data).
In this case, when the amount of chromatic aberration of magnification is detected from a taken image (indicated by square black marks), the amount of chromatic aberration of magnification should change as indicated by a broken line 612 in an area peripheral to the taken image. However, because only a small number of edges are detected from a subject such as the sky as described above, data obtained from this area is unreliable. For this reason, the amount of chromatic aberration of magnification for the entire taken image is determined without using that data.
As a result, as indicated by a solid line 613 in FIG. 6, the amount of chromatic aberration of magnification is determined using square black marks (detected values) in the area peripheral to the taken image. Thus, in the area peripheral to the taken image, a larger amount of correction for the chromatic aberration of magnification than a desired amount of correction for the chromatic aberration of magnification is determined. Therefore, excessive correction is performed in the area peripheral to the taken image.
Further, when chromatic aberration of magnification is to be corrected using lens design values relating to an image-forming optical system such as an image pickup lens, there may be a case where an accurate amount of correction for chromatic aberration of magnification cannot be determined due to manufacturing errors in the image-forming optical system such as an image pickup lens, shooting conditions, and so on. In this case, the amount of correction for chromatic aberration of magnification is determined to be small, and hence chromatic aberration of magnification cannot be satisfactorily corrected.